<!DOCTYPE HTML>
<html>
    <head>
        <title>ms-if</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
        <script src="../avalon.js" ></script>
        <script type="text/javascript">
            var model = avalon.define('test', function(vm) {
                vm.aaa = true
                vm.bbb = 2222
            })

            window.onload = function() {
                setTimeout(function() {
                    model.bbb = 333333
                }, 1000)
                setTimeout(function() {
                    model.aaa = false
                    console.log("以绑定方式移除DOM树")
                }, 3000)
                setTimeout(function() {
                    console.log("改变被移除元素的绑定值")
                    model.bbb = 444444
                }, 4000)
                setTimeout(function() {
                    model.aaa = true
                }, 6000)
            }

        </script>
        <style>
            #aaa{
                width:200px;
                height:200px;
                background: red;
                display:none;
            }
        </style>
    </head>
    <body>

        <div id="testDiv" ms-controller="test" >
            <div ms-if="aaa" id="remove">
                <div ms-text="bbb" ></div>
            </div>
            <div ms-if="aaa" ms-include-src="'if3tmpl.html'" id='eee'></div>
        </div>
    </body>
</html>